package com.blueocean_health.care.management.domain.dto;

import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.alibaba.fastjson.JSON;
import com.blueocean_health.care.management.common.base.string.StringUtils;
import com.blueocean_health.care.management.common.excel.ExcelResources;
import com.blueocean_health.care.management.em.ServiceTypeEnum;
import com.itextpdf.text.pdf.PdfStructTreeController.returnType;

/**
 * @author			作者:            zwg.BlueOcean
 * @date       			创建时间：2017年9月1日  上午9:34:09
 * @version  		版本号：    1.0*
 * @parameter  	* 
 * @since  			* 
 * @return  			*
 * @description	*	
 */
public class DepartmentDailyReport {
	private DecimalFormat deft = new DecimalFormat("#.00");
	private int id;
	private String departmentName;//科室
	private Integer department;//科室
	private Date admissionTime;//入院日期
	private String patientId;//患者id
	private String patientName;//患者名称
	private String workerName;//护工姓名
	private String serviceTypeName;//陪护形式
	private Date beginTime;//开始时间
	private Date endTime;//结束时间
	private String day;//小数点前为天数，后为小时数
	private Integer days;//陪护天数
	private Integer hours;//陪护小时数
	private Double totalPrice;//总费用
	private String  phone;//患者联系手机号

	private String workerId;
	private String serviceType;
	private String orderId;
	private String serviceId;
	private long version;
	// 订单类型  1：新入 2：续费  3：退款
	private String orderType;
	/**
	 * 1:24小时  2:12小时制
	 */
	private Integer orderTypeFlag;
	
	/**
	 * 总费用
	 */
	private Double actualTotalPrice;
	/**
	 * 每天费用
	 */
	private Double actualDayPrice;
	/**
	 * 每小时费用
	 */
	private Double oneHourPrice;
	
	SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	public Integer getDepartment() {
		return department;
	}
	public void setDepartment(Integer department) {
		this.department = department;
	}
	public String getOrderType() {
		return orderType;
	}
	public void setOrderType(String orderType) {
		this.orderType = orderType;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	@ExcelResources(title = "科室", order = 1)
	public String getDepartmentName() {
		return departmentName;
	}
	public void setDepartmentName(String departmentName) {
		this.departmentName = departmentName;
	}
	@ExcelResources(title = "入院日期", order = 2)
	public String getAdmissionTime() {
		if(StringUtils.isEmpty(admissionTime)){
			return null;
		}
		return df.format(admissionTime);
	}
	public void setAdmissionTime(Date admissionTime) {
		this.admissionTime = admissionTime;
	}
	@ExcelResources(title = "住院号", order = 3)
	public String getPatientId() {
		return patientId;
	}
	public void setPatientId(String patientId) {
		this.patientId = patientId;
	}
	@ExcelResources(title = "患者姓名", order = 4)
	public String getPatientName() {
		return patientName;
	}
	public void setPatientName(String patientName) {
		this.patientName = patientName;
	}
	@ExcelResources(title = "护工/小组", order = 5)
	public String getWorkerName() {
		return workerName;
	}
	public void setWorkerName(String workerName) {
		this.workerName = workerName;
	}
	@ExcelResources(title = "服务类型", order = 6)
	public String getServiceTypeName() {
		if(StringUtils.isEmpty("_" + getServiceType())){
			return null;
		}
		return ServiceTypeEnum.valueOf("_" + getServiceType()).getVal();
	}
	public void setServiceTypeName(String serviceTypeName) {
		this.serviceTypeName = serviceTypeName;
	}
	@ExcelResources(title = "用工周期-起", order = 7)
	public String getBeginTime() {
		return df.format(beginTime);
	}
	public void setBeginTime(Date beginTime) {
		this.beginTime = beginTime;
	}
	@ExcelResources(title = "用工周期-止", order = 8)
	public String getEndTime() {
		return df.format(endTime);
	}
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	@ExcelResources(title = "陪护天数", order = 9,isNum=2)
	public Integer getDays() {
		return days;
	}
	public void setDays(Integer days) {
		this.days = days;
	}
	public void setDay(String day) {
		this.day = day;
	}
	
	public String getDay() {
		return day;
	}
	@ExcelResources(title = "陪护小时数", order = 10,isNum=2)
	public Integer getHours() {
		return hours;
	}
	public void setHours(Integer hours) {
		this.hours = hours;
	}
	@ExcelResources(title = "实际服务费（元）", order = 11,isNum=1)
	public Double getTotalPrice() {
		return totalPrice;
	}
	public void setTotalPrice(Double totalPrice) {
		
		this.totalPrice = Double.valueOf(deft.format(totalPrice));
	}
	@ExcelResources(title = "关联订单号", order = 12)
	public String getOrderId() {
		return orderId;
	}
	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}
	public String getServiceId() {
		return serviceId;
	}
	public void setServiceId(String serviceId) {
		this.serviceId = serviceId;
	}
	
	public String getWorkerId() {
		return workerId;
	}
	public void setWorkerId(String workerId) {
		this.workerId = workerId;
	}
	public String getServiceType() {
		return serviceType;
	}
	public void setServiceType(String serviceType) {
		this.serviceType = serviceType;
	}
	public long getVersion() {
		return version;
	}
	public void setVersion(long version) {
		this.version = version;
	}
	
	
	
	public Double getActualTotalPrice() {
		return actualTotalPrice;
	}
	public void setActualTotalPrice(Double actualTotalPrice) {
		this.actualTotalPrice = actualTotalPrice;
	}
	public Double getActualDayPrice() {
		return actualDayPrice;
	}
	public void setActualDayPrice(Double actualDayPrice) {
		this.actualDayPrice = actualDayPrice;
	}
	public Double getOneHourPrice() {
		return oneHourPrice;
	}
	public SimpleDateFormat getDf() {
		return df;
	}
	public void setDf(SimpleDateFormat df) {
		this.df = df;
	}
	public void setOneHourPrice(Double oneHourPrice) {
		this.oneHourPrice = oneHourPrice;
	}
	
	public Integer getOrderTypeFlag() {
		return orderTypeFlag;
	}
	public void setOrderTypeFlag(Integer orderTypeFlag) {
		this.orderTypeFlag = orderTypeFlag;
	}
	@Override
	public String toString() {
//		return "DepartmentDailyReport [id=" + id + ", departmentName=" + departmentName + ", admissionTime="
//				+ admissionTime + ", patientId=" + patientId + ", patientName=" + patientName + ", workerName="
//				+ workerName + ", serviceTypeName=" + serviceTypeName + ", beginTime=" + beginTime + ", endTime="
//				+ endTime + ", days=" + days + ", hours=" + hours + ", totalPrice=" + totalPrice + ", orderId="
//				+ orderId + ", serviceId=" + serviceId + ", version=" + version + "]";
		return JSON.toJSONString(this);
	}
	
	

	
}

